<?php
require_once (BASE_PATH . '/phpmailer/class.phpmailer.php');
require_once (BASE_PATH . '/phpmailer/class.pop3.php');
require_once (BASE_PATH . '/phpmailer/class.smtp.php');
class QSource_System_Helper_Mail extends QSource_System{
	var $Mailer;
	public function __construct(){
		$this->Mailer = new PHPMailer();
	}
	public function Send($to,$body){
		$fromname = 'QSource Support Center';
		$fromemail ='noreply@vietincom.com';
		$title = 'QSource Email mail server' ;
		$this->Mailer->SetFrom ( $fromemail, $fromname );
		foreach ($to as $value) {
			$this->Mailer->AddAddress($value['email'],$value['name']);
		}
		$this->Mailer->AddReplyTo ( $fromemail, $fromname );
		$this->Mailer->Subject = $title;
		$this->Mailer->CharSet = "utf-8";
		$this->Mailer->Body = $body;
		return $this->Mailer->Send();
	}

	public function SendHTML($to,$body){
		$fromname = 'QSource Support Center';
		$fromemail ='noreply@vietincom.com';
		$title = 'QSource Email mail server' ;
		$this->Mailer->SetFrom ( $fromemail, $fromname );
		foreach ($to as $value) {
			$this->Mailer->AddAddress($value['email'],$value['name']);
		}
		$this->Mailer->AddReplyTo ($fromemail,$fromname);
		$this->Mailer->Subject = $title;
		$this->Mailer->CharSet = "utf-8";
		$this->Mailer->MsgHTML($body);
		return $this->Mailer->Send();
	}
	public function Send3(array $from,array $to,array $cc,array $bbc,array $reply){
		
	}
}